package com.pf.log.annotation.converter;

import com.google.common.collect.ImmutableMap;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

/**
 * @author PanFei
 * @version 1.0.0
 * @createTime 2022/9/10 23:16
 */
public class BooleanConverter implements Converter {

    @Override
    public String getDescription(String code) {
        Map<String, String> flagMap = ImmutableMap.of("true", "是", "false", "否");
        return StringUtils.isNotBlank(code) ? flagMap.get(code) : null;
    }
}
